package com.jy.modules.cims.component.common.service;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jy.modules.cims.data.common.dao.TCMmInteractClassParamterDao;
import com.jy.modules.cims.data.common.dto.TCMmInteractClassParamterDTO;
import com.jy.platform.core.common.BaseDTO;

/**
 * @classname: TCMmInteractClassParamterService
 * @description: 定义  T_C_MM_INTERACT_CLASS_PARAMTER 实现类
 * @author:  dell
 */
@Service("com.jy.modules.platform.tcmminteractclassparamter.service.TCMmInteractClassParamterService")
public class TCMmInteractClassParamterService implements Serializable {

    private static final long serialVersionUID = 1L;
    
	@Autowired
	private TCMmInteractClassParamterDao dao;

	/**
     * @author dell
     * @description: 分页查询 T_C_MM_INTERACT_CLASS_PARAMTER列表
     * @date 2015-02-02 17:46:40
     * @param searchParams 条件
     * @return
     * @throws
     */ 
	public List<TCMmInteractClassParamterDTO> searchTCMmInteractClassParamterByPaging(Map<String,Object> searchParams) throws Exception {
		List<TCMmInteractClassParamterDTO> dataList =  dao.searchTCMmInteractClassParamterByPaging(searchParams);
		return dataList;
	}
	/**
     * @author dell
     * @description: 按条件查询T_C_MM_INTERACT_CLASS_PARAMTER列表
     * @date 2015-02-02 17:46:40
     * @param searchParams 条件
     * @return
     * @throws
     */
	public List<TCMmInteractClassParamterDTO> searchTCMmInteractClassParamter(Map<String,Object> searchParams) throws Exception {
	    List<TCMmInteractClassParamterDTO> dataList = dao.searchTCMmInteractClassParamter(searchParams);
        return dataList;
    }
	/**
     * @author dell
     * @description: 查询T_C_MM_INTERACT_CLASS_PARAMTER对象
     * @date 2015-02-02 17:46:40
     * @param id
     * @return
     * @throws
     */ 
	public TCMmInteractClassParamterDTO queryTCMmInteractClassParamterByPrimaryKey(String id) throws Exception {
		
		TCMmInteractClassParamterDTO dto = dao.findTCMmInteractClassParamterByPrimaryKey(id);
		
		if(dto == null) dto = new TCMmInteractClassParamterDTO();
		
		return dto;
		
	}

	/**
     * @title: insertTCMmInteractClassParamter
     * @author dell
     * @description: 新增 T_C_MM_INTERACT_CLASS_PARAMTER对象
     * @date 2015-02-02 17:46:40
     * @param dto
     * @return
     * @throws
     */
	@SuppressWarnings("all")
	public Long insertTCMmInteractClassParamter(TCMmInteractClassParamterDTO dto) throws Exception {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("dto", dto);
		
		int count = dao.insertTCMmInteractClassParamter(paramMap);
		
		TCMmInteractClassParamterDTO resultDto = (TCMmInteractClassParamterDTO) paramMap.get("dto");
		Long keyId = resultDto.getId();
		return keyId;
	}
	/**
     * @title: updateTCMmInteractClassParamter
     * @author dell
     * @description: 修改 T_C_MM_INTERACT_CLASS_PARAMTER对象
     * @date 2015-02-02 17:46:40
     * @param paramMap
     * @return
     * @throws
     */
	public void updateTCMmInteractClassParamter(TCMmInteractClassParamterDTO dto) throws Exception {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("dto", dto);
		
		dao.updateTCMmInteractClassParamter(paramMap);
	}
	/**
     * @title: deleteTCMmInteractClassParamterByPrimaryKey
     * @author dell
     * @description: 删除 T_C_MM_INTERACT_CLASS_PARAMTER,按主键
     * @date 2015-02-02 17:46:40
     * @param paramMap
     * @throws
     */ 
	public void deleteTCMmInteractClassParamterByPrimaryKey(BaseDTO baseDto,String ids) throws Exception {
		if(StringUtils.isEmpty(ids)) throw new Exception("删除失败！传入的参数主键为null");
		
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("dto", baseDto);
		paramMap.put("ids", ids);
		dao.deleteTCMmInteractClassParamterByPrimaryKey(paramMap);
	}

}

